home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 1.iso / toolbox / documents / ELF / elf_fsize3e.txt < prev    next >
Encoding:
Text File  |  1996-11-11  |  2.6 KB  |  65 lines

  1.  
  2. elf_fsize(3E)                  Silicon Graphics                  elf_fsize(3E)
  3.  
  4. NAME
  5.      elf_fsize: elf32_fsize elf64_fsize - return the size of an object file
  6.      type
  7.  
  8. SYNOPSIS
  9.      cc [flag ...] file ...  -lelf [library ...]
  10.  
  11.      #include <libelf.h>
  12.  
  13.      size_t elf32_fsize(Elf_Type type, size_t count, unsigned ver);
  14.      size_t elf64_fsize(Elf_Type type, size_t count, unsigned ver);
  15.  
  16.      #define _LIBELF_XTND_64
  17.      Elf64_Xword elf64_fsize(Elf_Type type, Elf64_Xword count, unsigned ver);
  18.  
  19. DESCRIPTION
  20.      elf32_fsize gives the size in bytes of the 32-bit file representation of
  21.      count data objects with the given type.  The library uses version ver to
  22.      calculate the size [see elf(3E) and elf_version(3E)].
  23.  
  24.      Constant values are available for the sizes of fundamental types.
  25.  
  26.                 Elf_Type        File Size           Memory Size
  27.                _____________________________________________________
  28.                ELF_T_ADDR  | ELF32_FSZ_ADDR  | sizeof(Elf32_Addr)
  29.                ELF_T_BYTE  | 1               | sizeof(unsigned char)
  30.                ELF_T_HALF  | ELF32_FSZ_HALF  | sizeof(Elf32_Half)
  31.                ELT_T_OFF   | ELF32_FSZ_OFF   | sizeof(Elf32_Off)
  32.                ELF_T_SWORD | ELF32_FSZ_SWORD | sizeof(Elf32_Sword)
  33.                ELF_T_WORD  | ELF32_FSZ_WORD  | sizeof(Elf32_Word)
  34.                            |                 |
  35.                ____________|_________________|______________________
  36.  
  37.      elf32_fsize returns zero if the value of type or ver is unknown.  See
  38.      elf_xlate(3E) for a list of the type values.
  39.  
  40.      The 64-bit class works identically, simply replacing all instances of 32
  41.      in the description and table with 64.
  42.  
  43. SEE ALSO
  44.      elf(3E), elf_version(3E), elf_xlate(3E).
  45.  
  46. NOTES
  47.      The use of a size_t in a 32-bit compile with elf64_fsize is unfortunate,
  48.      since that makes it impossible to deal with certain object files.  If,
  49.      when the 32-bit app is compiled, _LIBELF_XTND_64 is defined, then the
  50.      function interface changes to have 64-bit fields.  If _LIBELF_XTND_64 is
  51.      defined at compile-time, then instead of linking with -lelf, link with
  52.      -lelf_xtnd.  There is a corresponding -ldwarf_xtnd.  It is essential that
  53.      a 32-bit application compiled with _LIBELF_XTND_64 be *entirely* compiled
  54.      with _LIBELF_XTND_64 defined.
  55.  
  56. Page 1                           Release 6.2
  57.  
  58. elf_fsize(3E)                  Silicon Graphics                  elf_fsize(3E)
  59.  
  60.      Applications which are built as 64-bit applications can ignore
  61.      _LIBELF_XTND_64: it has no effect on them and 64-bit applications always
  62.      link with -lelf never with -lelf_xtnd.
  63.  
  64. Page 2                           Release 6.2
  65.